package com.zuo.demo01.dao;

import com.zuo.demo01.pojo.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface BlogMapper {

    public List<Blog> findAll(Map<String,Object> map);

    public List<Blog> findAllPub(Map<String,Object> map);

    public List<Blog> findByKey(Map<String,Object> map);

    public List<Blog> findByType(Map<String,Object> map);//0是最新，1是最热

    public List<Blog> findByCategory(Map<String,Object> map);

    public List<Blog> getAll();

    public Blog getById(int id);

    public int update(Map<String,Object> map);

    public int addViews(Map<String,Object> map);

    public int delete(int id);

    public int count();

    public int countByPub();

    public int countByKey(String key);

    public int countByCategory(String categoryName);

    public int insert(Map<String,Object> map);


}
